home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / pms_104.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-04-23  |  2KB  |  84 lines

  1. /* REXX file to install the PMStripper on the deskop     */
  2. /* if you use this script as a starting point for your   */
  3. /* own install script and make improvements, please send */
  4. /* me a copy ---  dwhawk@southwind.net                   */
  5.  
  6. call rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  7. call sysloadfuncs                /* register system functions */
  8. address cmd '@echo off'          /* echo is turned off */
  9.  
  10. call SysCLS
  11.  
  12. say "PMStripper installation"
  13. say "Enter destination drive and directory"
  14. say "for example C:\OS2\APPS"
  15. say "to install in the curent directory just press enter"
  16.  
  17. pull dest
  18. call setup_dir(dest) 
  19. call copy_files
  20. call MKOBJ
  21. exit
  22.  
  23. check_ok:
  24.   say  'Okay to continue(Y/n) ? '        
  25.   k = SysGetKey('NOECHO') 
  26.   if k = 'Y' | k = 'y'  then return
  27.   say 'halting'
  28.     exit
  29.   end
  30.  
  31.  
  32. mkdir:  /* Procedure for creating dir */
  33.   Parse Arg dir
  34.   rc = SysMkDir(dir)
  35.   If (rc = 0 | rc = 5) Then Return
  36.   Say 'Problem creating destination directory "'dir'"'
  37.   Exit
  38.  
  39.  
  40. MKOBJ:
  41. Settings = 'EXENAME='direct||'\PMStrip.exe;'
  42. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  43. Settings = Settings||'ICONFILE='direct||'\PMStripb.ICO;'
  44. Settings = Settings||'CCVIEW=YES;'
  45. Settings = Settings||'STARTUPDIR='||direct';'
  46. Settings = Settings||'ASSOCFILTER=*.HTM,*.HTML;'
  47. rc=SysCreateObject('WPProgram','PMStripper','<WP_DESKTOP>',Settings,'R');
  48.  
  49. if rc = 1 then Say "PMStripper installed on desktop"
  50. return
  51. end
  52.  
  53. setup_dir:      /* accept install path and create it if needed */
  54.                 /* the desired install path is in ARG(1) */
  55.                 /* if no path is specified current directory is used*/
  56.  
  57. Parse Arg destin  /* parameter of setup_dir */
  58.  
  59. save_dest = destin    /*  save original destin to */
  60.                       /*  determine if copy needed */
  61.  
  62. If destin = "" Then destin = Directory()
  63.  
  64. Say "Shall I install in "destin" ?"
  65. Call Check_Ok  /* your check routine */
  66.  
  67. Parse Var destin direct ':\' destin   /* get drive name only */
  68. direct=direct':'
  69.  
  70. Do Until destin = ""     /* No matter how many sub dirs present */
  71.   Parse Var destin sub '\' destin
  72.   direct=direct'\'sub
  73.   Call mkdir direct
  74. End
  75. return
  76.  
  77. copy_files:
  78. if save_dest \= ""  then do
  79.    'COPY PMStrip.EXE ' direct
  80.    'COPY PMStrip?.ICO ' direct
  81. end
  82. return
  83. end
  84.